﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Mask;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraLayout;
    using DevExpress.XtraLayout.Utils;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using Dictionary;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;

    public class xfmIncrease : XtraForm
    {
        private SimpleButton btClose;
        private SimpleButton btIncrease;
        private SimpleButton btNext;
        private CalcEdit calRate;
        private ComboBoxEdit cboHospital;
        private ComboBoxEdit cboProvince;
        private GridColumn colInsuranceTableListName;
        private IContainer components;
        private DataTable dt_Employee;
        private DateEdit dtFromDate;
        private EmptySpaceItem emptySpaceItem1;
        private GridLookUpEdit glkInsuranceTableList;
        private GridView gridLookUpEdit1View;
        private GroupControl groupControl1;
        private DevExpress.Utils.ImageCollection imageCollection1;
        private LayoutControl layoutControl1;
        private LayoutControlGroup layoutControlGroup1;
        private LayoutControlItem layoutControlItem1;
        private LayoutControlItem layoutControlItem2;
        private LayoutControlItem layoutControlItem3;
        private LayoutControlItem layoutControlItem4;
        private LayoutControlItem layoutControlItem5;
        private LayoutControlItem layoutControlItem6;
        private LayoutControlItem layoutControlItem7;
        private LayoutControlItem layoutControlItem8;
        private LayoutControlItem layoutControlItem9;
        private int m_Count;
        private string m_Description;
        private string m_EmployeeCode;
        private string m_EmployeeName;
        private System.DateTime m_FromDate;
        private string m_HealthInsuranceCode;
        private string m_Hospital;
        private string m_IDCard;
        private Guid m_InsuranceID;
        private Guid m_InsuranceTableListID;
        private bool m_IsPay;
        private string m_MainAddress;
        private decimal m_NewAllowance1;
        private decimal m_NewAllowance2;
        private decimal m_NewAllowance3;
        private decimal m_NewAllowance4;
        private decimal m_NewSalary;
        private decimal m_OldAllowance1;
        private decimal m_OldAllowance2;
        private decimal m_OldAllowance3;
        private decimal m_OldAllowance4;
        private decimal m_OldSalary;
        private string m_Province;
        private double m_Rate;
        private bool m_Sex;
        private string m_SocialInsuranceCode;
        private System.DateTime m_ToDate;
        private int m_Type;
        private RadioGroup radioGroup1;
        private MemoEdit txtDescription;
        private TextEdit txtHealthInsuranceCode;
        private TextEdit txtSocialInsuranceCode;

        public event CreatedEventHander Created;

        public xfmIncrease()
        {
            this.components = null;
            this.m_Count = 0;
            this.InitializeComponent();
            this.Init();
        }

        public xfmIncrease(HRM_INSURANCE cls)
        {
            this.components = null;
            this.m_Count = 0;
            this.InitializeComponent();
        }

        public xfmIncrease(DataTable Employee)
        {
            this.components = null;
            this.m_Count = 0;
            this.InitializeComponent();
            this.dt_Employee = Employee;
            this.m_Count = this.dt_Employee.Rows.Count - 1;
            this.Init();
        }

        private void AddComboboxEdit(ComboBoxEdit combo, string str)
        {
            combo.Properties.Items.Add(str);
            combo.SelectedIndex = combo.Properties.Items.Count - 1;
        }

        private void btClose_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btIncrease_Click(object sender, EventArgs e)
        {
            if (this.glkInsuranceTableList.EditValue == null)
            {
                XtraMessageBox.Show("Vui l\x00f2ng chọn đợt b\x00e1o c\x00e1o cần ph\x00e1t sinh!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                HRM_INSURANCE hrm_insurance = new HRM_INSURANCE();
                if (this.InitClass().Insert() == "OK")
                {
                    if (this.btNext.Enabled)
                    {
                        this.SetValue(this.m_Count);
                    }
                    else
                    {
                        XtraMessageBox.Show("Dữ liệu ph\x00e1t sinh đ\x00e3 được lưu lại!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        this.RaiseCreatedEventHander();
                        base.Close();
                    }
                }
                else
                {
                    XtraMessageBox.Show("Dữ liệu kh\x00f4ng được lưu!\nVui l\x00f2ng kiểm tra lại!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }
        }

        private void btNext_Click(object sender, EventArgs e)
        {
            this.SetValue(this.m_Count);
        }

        private void cbo_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            FormClosingEventHandler handler = null;
            FormClosingEventHandler handler2 = null;
            if (e.Button.Kind == ButtonPredefines.Glyph)
            {
                ComboBoxEdit edit = sender as ComboBoxEdit;
                string name = edit.Name;
                if (name != null)
                {
                    if (!(name == "cboProvince"))
                    {
                        if (name == "cboHospital")
                        {
                            xfmHospital hospital = new xfmHospital();
                            if (handler2 == null)
                            {
                                handler2 = (s, i) => new DIC_HOSPITAL().AddComboEdit(this.cboHospital);
                            }
                            hospital.FormClosing += handler2;
                            hospital.ShowDialog();
                        }
                    }
                    else
                    {
                        xfmProvince province = new xfmProvince();
                        if (handler == null)
                        {
                            handler = (s, i) => new DIC_PROVINCE().AddComboEdit(this.cboProvince);
                        }
                        province.FormClosing += handler;
                        province.ShowDialog();
                    }
                }
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void glk_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            xfmInsuranceAdd.AddedEventHander hander = null;
            if (e.Button.Kind == ButtonPredefines.Glyph)
            {
                GridLookUpEdit edit = sender as GridLookUpEdit;
                string name = edit.Name;
                if ((name != null) && (name == "glkInsuranceTableList"))
                {
                    xfmInsuranceAdd add = new xfmInsuranceAdd(Actions.Add);
                    if (hander == null)
                    {
                        hander = (s, i) => new HRM_INSURANCE_TABLELIST().AddGridLookupEdit(this.glkInsuranceTableList);
                    }
                    add.Added += hander;
                    add.ShowDialog();
                }
            }
        }

        private void Init()
        {
            this.InitData();
            this.SetValue(this.m_Count);
        }

        private HRM_INSURANCE InitClass()
        {
            return new HRM_INSURANCE { 
                InsuranceID = Guid.NewGuid(), InsuranceTableListID = new Guid(this.glkInsuranceTableList.EditValue.ToString()), EmployeeCode = this.m_EmployeeCode, EmployeeName = this.m_EmployeeName, Sex = this.m_Sex, IDCard = this.m_IDCard, MainAddress = this.m_MainAddress, OldSalary = this.m_OldSalary, OldAllowance1 = this.m_OldAllowance1, OldAllowance2 = this.m_OldAllowance2, OldAllowance3 = this.m_OldAllowance3, OldAllowance4 = this.m_OldAllowance4, NewSalary = this.m_NewSalary, NewAllowance1 = this.m_NewAllowance1, NewAllowance2 = this.m_NewAllowance2, NewAllowance3 = this.m_NewAllowance3, 
                NewAllowance4 = this.m_NewAllowance4, Type = this.m_Type, IsPay = this.m_IsPay, SocialInsuranceCode = this.txtSocialInsuranceCode.Text, HealthInsuranceCode = this.txtHealthInsuranceCode.Text, Province = this.cboProvince.Text, Hospital = this.cboHospital.Text, FromDate = this.dtFromDate.DateTime, Rate = double.Parse(this.calRate.EditValue.ToString()), Description = this.txtDescription.Text
             };
        }

        private void InitData()
        {
            new HRM_INSURANCE_TABLELIST().AddGridLookupEdit(this.glkInsuranceTableList);
            new DIC_PROVINCE().AddComboEdit(this.cboProvince);
            new DIC_HOSPITAL().AddComboEdit(this.cboHospital);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xfmIncrease));
            SerializableAppearanceObject appearance = new SerializableAppearanceObject();
            SerializableAppearanceObject obj3 = new SerializableAppearanceObject();
            SerializableAppearanceObject obj4 = new SerializableAppearanceObject();
            this.groupControl1 = new GroupControl();
            this.layoutControl1 = new LayoutControl();
            this.cboHospital = new ComboBoxEdit();
            this.cboProvince = new ComboBoxEdit();
            this.glkInsuranceTableList = new GridLookUpEdit();
            this.gridLookUpEdit1View = new GridView();
            this.colInsuranceTableListName = new GridColumn();
            this.calRate = new CalcEdit();
            this.txtHealthInsuranceCode = new TextEdit();
            this.txtSocialInsuranceCode = new TextEdit();
            this.dtFromDate = new DateEdit();
            this.radioGroup1 = new RadioGroup();
            this.txtDescription = new MemoEdit();
            this.layoutControlGroup1 = new LayoutControlGroup();
            this.layoutControlItem1 = new LayoutControlItem();
            this.layoutControlItem2 = new LayoutControlItem();
            this.layoutControlItem5 = new LayoutControlItem();
            this.layoutControlItem3 = new LayoutControlItem();
            this.layoutControlItem4 = new LayoutControlItem();
            this.layoutControlItem8 = new LayoutControlItem();
            this.layoutControlItem9 = new LayoutControlItem();
            this.emptySpaceItem1 = new EmptySpaceItem();
            this.layoutControlItem6 = new LayoutControlItem();
            this.layoutControlItem7 = new LayoutControlItem();
            this.btIncrease = new SimpleButton();
            this.imageCollection1 = new DevExpress.Utils.ImageCollection(this.components);
            this.btClose = new SimpleButton();
            this.btNext = new SimpleButton();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.layoutControl1.BeginInit();
            this.layoutControl1.SuspendLayout();
            this.cboHospital.Properties.BeginInit();
            this.cboProvince.Properties.BeginInit();
            this.glkInsuranceTableList.Properties.BeginInit();
            this.gridLookUpEdit1View.BeginInit();
            this.calRate.Properties.BeginInit();
            this.txtHealthInsuranceCode.Properties.BeginInit();
            this.txtSocialInsuranceCode.Properties.BeginInit();
            this.dtFromDate.Properties.VistaTimeProperties.BeginInit();
            this.dtFromDate.Properties.BeginInit();
            this.radioGroup1.Properties.BeginInit();
            this.txtDescription.Properties.BeginInit();
            this.layoutControlGroup1.BeginInit();
            this.layoutControlItem1.BeginInit();
            this.layoutControlItem2.BeginInit();
            this.layoutControlItem5.BeginInit();
            this.layoutControlItem3.BeginInit();
            this.layoutControlItem4.BeginInit();
            this.layoutControlItem8.BeginInit();
            this.layoutControlItem9.BeginInit();
            this.emptySpaceItem1.BeginInit();
            this.layoutControlItem6.BeginInit();
            this.layoutControlItem7.BeginInit();
            this.imageCollection1.BeginInit();
            base.SuspendLayout();
            this.groupControl1.Controls.Add(this.layoutControl1);
            this.groupControl1.Dock = DockStyle.Top;
            this.groupControl1.Location = new Point(0, 0);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.ShowCaption = false;
            this.groupControl1.Size = new Size(0x1cd, 0x120);
            this.groupControl1.TabIndex = 0;
            this.groupControl1.Text = "Th\x00f4ng tin";
            this.layoutControl1.Controls.Add(this.cboHospital);
            this.layoutControl1.Controls.Add(this.cboProvince);
            this.layoutControl1.Controls.Add(this.glkInsuranceTableList);
            this.layoutControl1.Controls.Add(this.calRate);
            this.layoutControl1.Controls.Add(this.txtHealthInsuranceCode);
            this.layoutControl1.Controls.Add(this.txtSocialInsuranceCode);
            this.layoutControl1.Controls.Add(this.dtFromDate);
            this.layoutControl1.Controls.Add(this.radioGroup1);
            this.layoutControl1.Controls.Add(this.txtDescription);
            this.layoutControl1.Dock = DockStyle.Fill;
            this.layoutControl1.Location = new Point(2, 2);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.Root = this.layoutControlGroup1;
            this.layoutControl1.Size = new Size(0x1c9, 0x11c);
            this.layoutControl1.TabIndex = 1;
            this.layoutControl1.Text = "layoutControl1";
            this.cboHospital.Location = new Point(0x69, 0x79);
            this.cboHospital.Name = "cboHospital";
            this.cboHospital.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("cboHospital.Properties.Buttons"), new KeyShortcut(Keys.None), appearance, "", null, null, true) });
            this.cboHospital.Size = new Size(0x159, 0x16);
            this.cboHospital.StyleController = this.layoutControl1;
            this.cboHospital.TabIndex = 4;
            this.cboHospital.ButtonClick += new ButtonPressedEventHandler(this.cbo_ButtonClick);
            this.cboProvince.Location = new Point(0x69, 0x5f);
            this.cboProvince.Name = "cboProvince";
            this.cboProvince.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("cboProvince.Properties.Buttons"), new KeyShortcut(Keys.None), obj3, "", null, null, true) });
            this.cboProvince.Size = new Size(0x159, 0x16);
            this.cboProvince.StyleController = this.layoutControl1;
            this.cboProvince.TabIndex = 3;
            this.cboProvince.ButtonClick += new ButtonPressedEventHandler(this.cbo_ButtonClick);
            this.glkInsuranceTableList.Location = new Point(0x69, 0xff);
            this.glkInsuranceTableList.Name = "glkInsuranceTableList";
            this.glkInsuranceTableList.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("glkInsuranceTableList.Properties.Buttons"), new KeyShortcut(Keys.None), obj4, "", null, null, true) });
            this.glkInsuranceTableList.Properties.NullText = "[Chọn đợt b\x00e1o c\x00e1o để ph\x00e1t sinh]";
            this.glkInsuranceTableList.Properties.View = this.gridLookUpEdit1View;
            this.glkInsuranceTableList.Size = new Size(0x159, 0x16);
            this.glkInsuranceTableList.StyleController = this.layoutControl1;
            this.glkInsuranceTableList.TabIndex = 8;
            this.glkInsuranceTableList.ButtonClick += new ButtonPressedEventHandler(this.glk_ButtonClick);
            this.gridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.colInsuranceTableListName });
            this.gridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridLookUpEdit1View.Name = "gridLookUpEdit1View";
            this.gridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.colInsuranceTableListName.Caption = "Đợt b\x00e1o c\x00e1o";
            this.colInsuranceTableListName.FieldName = "InsuranceTableListName";
            this.colInsuranceTableListName.Name = "colInsuranceTableListName";
            this.colInsuranceTableListName.Visible = true;
            this.colInsuranceTableListName.VisibleIndex = 0;
            this.calRate.Location = new Point(0x15a, 0x95);
            this.calRate.Name = "calRate";
            this.calRate.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calRate.Size = new Size(0x68, 20);
            this.calRate.StyleController = this.layoutControl1;
            this.calRate.TabIndex = 6;
            this.txtHealthInsuranceCode.Location = new Point(0x13f, 0x45);
            this.txtHealthInsuranceCode.Name = "txtHealthInsuranceCode";
            this.txtHealthInsuranceCode.Size = new Size(0x83, 20);
            this.txtHealthInsuranceCode.StyleController = this.layoutControl1;
            this.txtHealthInsuranceCode.TabIndex = 2;
            this.txtSocialInsuranceCode.Location = new Point(0x69, 0x45);
            this.txtSocialInsuranceCode.Name = "txtSocialInsuranceCode";
            this.txtSocialInsuranceCode.Size = new Size(0x8e, 20);
            this.txtSocialInsuranceCode.StyleController = this.layoutControl1;
            this.txtSocialInsuranceCode.TabIndex = 1;
            this.dtFromDate.EditValue = null;
            this.dtFromDate.Location = new Point(0x69, 0x95);
            this.dtFromDate.Name = "dtFromDate";
            this.dtFromDate.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtFromDate.Properties.DisplayFormat.FormatString = "MM/yyyy";
            this.dtFromDate.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
            this.dtFromDate.Properties.EditFormat.FormatString = "MM/yyyy";
            this.dtFromDate.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
            this.dtFromDate.Properties.Mask.EditMask = "MM/yyyy";
            this.dtFromDate.Properties.Mask.MaskType = MaskType.DateTimeAdvancingCaret;
            this.dtFromDate.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.dtFromDate.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtFromDate.Size = new Size(0x8f, 20);
            this.dtFromDate.StyleController = this.layoutControl1;
            this.dtFromDate.TabIndex = 5;
            this.radioGroup1.Location = new Point(7, 7);
            this.radioGroup1.Name = "radioGroup1";
            this.radioGroup1.Properties.Appearance.BackColor = Color.Transparent;
            this.radioGroup1.Properties.Appearance.Options.UseBackColor = true;
            this.radioGroup1.Properties.BorderStyle = BorderStyles.NoBorder;
            this.radioGroup1.Properties.Items.AddRange(new RadioGroupItem[] { new RadioGroupItem(null, "Tăng mới (TM)"), new RadioGroupItem(null, "Tăng sau khi nghỉ thai sản, ốm đau hoặc nghỉ kh\x00f4ng lương d\x00e0i ng\x00e0y (ON)") });
            this.radioGroup1.Size = new Size(0x1bb, 0x38);
            this.radioGroup1.StyleController = this.layoutControl1;
            this.radioGroup1.TabIndex = 0;
            this.txtDescription.Location = new Point(0x69, 0xb1);
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.Size = new Size(0x159, 0x3e);
            this.txtDescription.StyleController = this.layoutControl1;
            this.txtDescription.TabIndex = 7;
            this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
            this.layoutControlGroup1.EnableIndentsWithoutBorders = DefaultBoolean.True;
            this.layoutControlGroup1.GroupBordersVisible = false;
            this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem1, this.layoutControlItem2, this.layoutControlItem5, this.layoutControlItem3, this.layoutControlItem4, this.layoutControlItem8, this.layoutControlItem9, this.emptySpaceItem1, this.layoutControlItem6, this.layoutControlItem7 });
            this.layoutControlGroup1.Location = new Point(0, 0);
            this.layoutControlGroup1.Name = "layoutControlGroup1";
            this.layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5);
            this.layoutControlGroup1.Size = new Size(0x1c9, 0x11c);
            this.layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlGroup1.Text = "layoutControlGroup1";
            this.layoutControlGroup1.TextVisible = false;
            this.layoutControlItem1.Control = this.radioGroup1;
            this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
            this.layoutControlItem1.Location = new Point(0, 0);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.Size = new Size(0x1bf, 60);
            this.layoutControlItem1.Text = "layoutControlItem1";
            this.layoutControlItem1.TextSize = new Size(0, 0);
            this.layoutControlItem1.TextToControlDistance = 0;
            this.layoutControlItem1.TextVisible = false;
            this.layoutControlItem2.Control = this.dtFromDate;
            this.layoutControlItem2.CustomizationFormText = "Tăng từ th\x00e1ng:";
            this.layoutControlItem2.Location = new Point(0, 140);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Size = new Size(0xf5, 0x1c);
            this.layoutControlItem2.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 2, 2);
            this.layoutControlItem2.Text = "Tăng từ th\x00e1ng:";
            this.layoutControlItem2.TextSize = new Size(0x5e, 13);
            this.layoutControlItem5.Control = this.txtDescription;
            this.layoutControlItem5.CustomizationFormText = "layoutControlItem5";
            this.layoutControlItem5.Location = new Point(0, 0xa8);
            this.layoutControlItem5.Name = "layoutControlItem5";
            this.layoutControlItem5.Size = new Size(0x1bf, 70);
            this.layoutControlItem5.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 2, 2);
            this.layoutControlItem5.Text = "Ghi ch\x00fa bổ sung:";
            this.layoutControlItem5.TextSize = new Size(0x5e, 13);
            this.layoutControlItem3.Control = this.txtSocialInsuranceCode;
            this.layoutControlItem3.CustomizationFormText = "Số sổ BHXH:";
            this.layoutControlItem3.Location = new Point(0, 60);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.Size = new Size(0xf4, 0x1c);
            this.layoutControlItem3.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 2, 2);
            this.layoutControlItem3.Text = "Số sổ BHXH:";
            this.layoutControlItem3.TextSize = new Size(0x5e, 13);
            this.layoutControlItem4.Control = this.txtHealthInsuranceCode;
            this.layoutControlItem4.CustomizationFormText = "Số thẻ BHYT:";
            this.layoutControlItem4.Location = new Point(0xf4, 60);
            this.layoutControlItem4.Name = "layoutControlItem4";
            this.layoutControlItem4.Size = new Size(0xcb, 0x1c);
            this.layoutControlItem4.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 2, 2);
            this.layoutControlItem4.Text = "Số thẻ BHYT:";
            this.layoutControlItem4.TextAlignMode = TextAlignModeItem.AutoSize;
            this.layoutControlItem4.TextSize = new Size(0x3f, 13);
            this.layoutControlItem4.TextToControlDistance = 5;
            this.layoutControlItem8.Control = this.calRate;
            this.layoutControlItem8.CustomizationFormText = "Tỷ lệ nộp bổ sung:";
            this.layoutControlItem8.Location = new Point(0xf5, 140);
            this.layoutControlItem8.Name = "layoutControlItem8";
            this.layoutControlItem8.Size = new Size(0xca, 0x1c);
            this.layoutControlItem8.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 2, 2);
            this.layoutControlItem8.Text = "Tỷ lệ nộp bổ sung:";
            this.layoutControlItem8.TextAlignMode = TextAlignModeItem.AutoSize;
            this.layoutControlItem8.TextSize = new Size(0x59, 13);
            this.layoutControlItem8.TextToControlDistance = 5;
            this.layoutControlItem9.Control = this.glkInsuranceTableList;
            this.layoutControlItem9.CustomizationFormText = "Chọn đợt b\x00e1o c\x00e1o:";
            this.layoutControlItem9.Location = new Point(0, 0xf8);
            this.layoutControlItem9.Name = "layoutControlItem9";
            this.layoutControlItem9.Size = new Size(0x1bf, 0x1a);
            this.layoutControlItem9.Text = "Chọn đợt b\x00e1o c\x00e1o:";
            this.layoutControlItem9.TextSize = new Size(0x5e, 13);
            this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
            this.emptySpaceItem1.Location = new Point(0, 0xee);
            this.emptySpaceItem1.Name = "emptySpaceItem1";
            this.emptySpaceItem1.Size = new Size(0x1bf, 10);
            this.emptySpaceItem1.Text = "emptySpaceItem1";
            this.emptySpaceItem1.TextSize = new Size(0, 0);
            this.layoutControlItem6.Control = this.cboProvince;
            this.layoutControlItem6.CustomizationFormText = "Tỉnh:";
            this.layoutControlItem6.Location = new Point(0, 0x58);
            this.layoutControlItem6.Name = "layoutControlItem6";
            this.layoutControlItem6.Size = new Size(0x1bf, 0x1a);
            this.layoutControlItem6.Text = "T\x00ean tỉnh KCB:";
            this.layoutControlItem6.TextSize = new Size(0x5e, 13);
            this.layoutControlItem7.Control = this.cboHospital;
            this.layoutControlItem7.CustomizationFormText = "Bệnh viện:";
            this.layoutControlItem7.Location = new Point(0, 0x72);
            this.layoutControlItem7.Name = "layoutControlItem7";
            this.layoutControlItem7.Size = new Size(0x1bf, 0x1a);
            this.layoutControlItem7.Text = "T\x00ean bệnh viện KCB:";
            this.layoutControlItem7.TextSize = new Size(0x5e, 13);
            this.btIncrease.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btIncrease.ImageIndex = 2;
            this.btIncrease.ImageList = this.imageCollection1;
            this.btIncrease.Location = new Point(0x66, 0x12b);
            this.btIncrease.Name = "btIncrease";
            this.btIncrease.Size = new Size(0x8b, 0x17);
            this.btIncrease.TabIndex = 0;
            this.btIncrease.Text = "Ph\x00e1t Sinh Tăng (>>)";
            this.btIncrease.Click += new EventHandler(this.btIncrease_Click);
            this.imageCollection1.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection1.ImageStream");
            this.imageCollection1.Images.SetKeyName(0, "ico_alpha_Search_16x16.png");
            this.imageCollection1.Images.SetKeyName(1, "ico_alpha_Delete_16x16.png");
            this.imageCollection1.Images.SetKeyName(2, "document2.png");
            this.imageCollection1.Images.SetKeyName(3, "open-16x16.png");
            this.imageCollection1.Images.SetKeyName(4, "direction_next.png");
            this.btClose.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btClose.ImageIndex = 1;
            this.btClose.ImageList = this.imageCollection1;
            this.btClose.Location = new Point(0x163, 0x12b);
            this.btClose.Name = "btClose";
            this.btClose.Size = new Size(0x59, 0x17);
            this.btClose.TabIndex = 2;
            this.btClose.Text = "Đ\x00f3ng (X)";
            this.btClose.Click += new EventHandler(this.btClose_Click);
            this.btNext.ImageIndex = 4;
            this.btNext.ImageList = this.imageCollection1;
            this.btNext.Location = new Point(0xf8, 0x12b);
            this.btNext.Name = "btNext";
            this.btNext.Size = new Size(0x65, 0x17);
            this.btNext.TabIndex = 1;
            this.btNext.Text = "Bỏ qua (>>)";
            this.btNext.Click += new EventHandler(this.btNext_Click);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x1cd, 330);
            base.Controls.Add(this.btNext);
            base.Controls.Add(this.btClose);
            base.Controls.Add(this.btIncrease);
            base.Controls.Add(this.groupControl1);
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "xfmIncrease";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "Ph\x00e1t Sinh Tăng";
            base.Load += new EventHandler(this.xfmIncrease_Load);
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.layoutControl1.EndInit();
            this.layoutControl1.ResumeLayout(false);
            this.cboHospital.Properties.EndInit();
            this.cboProvince.Properties.EndInit();
            this.glkInsuranceTableList.Properties.EndInit();
            this.gridLookUpEdit1View.EndInit();
            this.calRate.Properties.EndInit();
            this.txtHealthInsuranceCode.Properties.EndInit();
            this.txtSocialInsuranceCode.Properties.EndInit();
            this.dtFromDate.Properties.VistaTimeProperties.EndInit();
            this.dtFromDate.Properties.EndInit();
            this.radioGroup1.Properties.EndInit();
            this.txtDescription.Properties.EndInit();
            this.layoutControlGroup1.EndInit();
            this.layoutControlItem1.EndInit();
            this.layoutControlItem2.EndInit();
            this.layoutControlItem5.EndInit();
            this.layoutControlItem3.EndInit();
            this.layoutControlItem4.EndInit();
            this.layoutControlItem8.EndInit();
            this.layoutControlItem9.EndInit();
            this.emptySpaceItem1.EndInit();
            this.layoutControlItem6.EndInit();
            this.layoutControlItem7.EndInit();
            this.imageCollection1.EndInit();
            base.ResumeLayout(false);
        }

        public void RaiseCreatedEventHander()
        {
            if (this.Created != null)
            {
                this.Created(this);
            }
        }

        private void SetValue(int Record)
        {
            this.m_EmployeeCode = this.dt_Employee.Rows[Record]["EmployeeCode"].ToString();
            this.m_EmployeeName = this.dt_Employee.Rows[Record]["FirstName"].ToString() + " " + this.dt_Employee.Rows[Record]["LastName"].ToString();
            this.m_Sex = bool.Parse(this.dt_Employee.Rows[Record]["Sex"].ToString());
            this.m_IDCard = this.dt_Employee.Rows[Record]["IDCard"].ToString();
            this.m_MainAddress = this.dt_Employee.Rows[Record]["MainAddress"].ToString();
            this.m_OldSalary = 0M;
            this.m_OldAllowance1 = 0M;
            this.m_OldAllowance2 = 0M;
            this.m_OldAllowance3 = 0M;
            this.m_OldAllowance4 = 0M;
            this.m_NewSalary = decimal.Parse(this.dt_Employee.Rows[Record]["InsuranceSalary"].ToString());
            this.m_NewAllowance1 = decimal.Parse(this.dt_Employee.Rows[Record]["Allowance1"].ToString());
            this.m_NewAllowance2 = decimal.Parse(this.dt_Employee.Rows[Record]["Allowance2"].ToString());
            this.m_NewAllowance3 = decimal.Parse(this.dt_Employee.Rows[Record]["Allowance3"].ToString());
            this.m_NewAllowance4 = decimal.Parse(this.dt_Employee.Rows[Record]["Allowance4"].ToString());
            this.m_Type = 1;
            this.m_IsPay = false;
            this.m_SocialInsuranceCode = this.txtSocialInsuranceCode.Text = this.dt_Employee.Rows[Record]["InsuranceCode"].ToString();
            this.m_HealthInsuranceCode = this.txtHealthInsuranceCode.Text = this.dt_Employee.Rows[Record]["HealthInsuranceCode"].ToString();
            this.m_Province = this.cboProvince.Text = this.dt_Employee.Rows[Record]["Province"].ToString();
            this.m_Hospital = this.cboHospital.Text = this.dt_Employee.Rows[Record]["Hospital"].ToString();
            this.m_FromDate = this.dtFromDate.DateTime = System.DateTime.Now;
            this.calRate.EditValue = this.m_Rate = 0.0;
            this.m_Description = this.txtDescription.Text = "";
            this.m_Count--;
            if (this.m_Count < 0)
            {
                this.btNext.Enabled = false;
            }
            string[] strArray = new string[] { "Ph\x00e1t Sinh Tăng - ", this.m_EmployeeName, " (", this.m_EmployeeCode, ") - ", (this.m_Count + 1).ToString(), " mẫu tin đang đợi" };
            this.Text = string.Concat(strArray);
        }

        private void xfmIncrease_Load(object sender, EventArgs e)
        {
        }

        public delegate void CreatedEventHander(object sender);
    }
}

